package hu.mapro.model.roo;

import static hu.mapro.model.roo.MaproModelJavaType.ROO_MAPRO_PROXY;
import static hu.mapro.model.roo.MaproModelJavaType.ROO_MAPRO_PROXY;
import static java.lang.reflect.Modifier.PUBLIC;
import static org.springframework.roo.classpath.PhysicalTypeCategory.INTERFACE;

import org.springframework.roo.classpath.details.ClassOrInterfaceTypeDetailsBuilder;
import org.springframework.roo.classpath.details.annotations.AnnotationMetadataBuilder;

public class MaproModelUtil {

	public static void initProxy(final ClassOrInterfaceTypeDetailsBuilder cidBuilder) {
		cidBuilder.setPhysicalTypeCategory(INTERFACE);
	    cidBuilder.setModifier(PUBLIC);
	    cidBuilder.updateTypeAnnotation(new AnnotationMetadataBuilder(
	            ROO_MAPRO_PROXY));
	}

	public static void initProxyAccessor(final ClassOrInterfaceTypeDetailsBuilder cidBuilder) {
		cidBuilder.setPhysicalTypeCategory(INTERFACE);
		cidBuilder.setModifier(PUBLIC);
		cidBuilder.updateTypeAnnotation(new AnnotationMetadataBuilder(
				MaproModelJavaType.ROO_MAPRO_PROXY_ACCESSOR));
	}
	
}
